<template>
    <div class="todo-wrap">
        {{todo.count}}
        {{todos}}
        <!-- <header>
            {{count}}
            <h1>输入待办事项：</h1>
            <input type="checkbox" :checked="checkAll" @change="toggleCheck(!checkAll)">
            <input type="text" placeholder="输入待办事项："  @keyup.enter="addTodo">
        </header>
        <div class="con">
            <todo-item v-for="item in todos" :key="item.id" :todo="item"></todo-item>
        </div>
        <footer>
            未完成的数量:{{notDoneCount}}
        </footer> -->
    </div>
</template>
<script>
import todoItem from '../components/todoItem'
import {mapGetters,mapState,mapActions} from 'vuex'
export default {
    created(){
        // this.$store.dispatch('getTodos')
        // this.getTodos()
        // this.$http
    },
    components:{
        todoItem
    },
    methods:{
        // addTodo(e){
        //     let val = e.target.value.trim();
        //     this.$store.dispatch('addTodos',val);
        //     e.target.value = '';
        // },
        // ...mapActions(['toggleCheck','getTodos'])
    },
    computed: {
        // todos(){
        //     return this.$store.state.todos
        // },
        // checkAll(){
        //     return this.todos.every(item => item.done)
        // },
        ...mapState(['todos','count']),
        ...mapGetters(['notDoneCount'])
    },
}
</script>

